﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GalaSoft.MvvmLight;
using System.Windows;
using System.Windows.Media;

namespace PatternLockControl.Code
{
    public abstract class PatternDesignBase : ViewModelBase
    {
        #region Data
        #region FillColNormalProperty
        private Color _FillColNormal;
        public Color FillColNormal
        {
            get
            { return _FillColNormal; }
            set
            {
                if (_FillColNormal == value)
                {
                    return;
                }
                _FillColNormal = value;
                RaisePropertyChanged("FillColNormal");
                FillBrushNormal = new SolidColorBrush(_FillColNormal);
            }
        }
        #endregion

        #region FillColrSelectedProperty
        private Color _FillColrSelected;
        public Color FillColrSelected
        {
            get
            { return _FillColrSelected; }
            set
            {
                if (_FillColrSelected == value)
                {
                    return;
                }
                _FillColrSelected = value;
                RaisePropertyChanged("FillColrSelected");
                FillBrushSelected = new SolidColorBrush(_FillColrSelected);
            }
        }
        #endregion

        #region FillBrushNormalProperty
        private SolidColorBrush _FillBrushNormal;
        public SolidColorBrush FillBrushNormal
        {
            get
            { return _FillBrushNormal; }
            private set
            {
                if (_FillBrushNormal == value)
                {
                    return;
                }
                _FillBrushNormal = value;
                RaisePropertyChanged("FillBrushNormal");
            }
        }
        #endregion

        #region FillBrushSelectedProperty
        private SolidColorBrush _FillBrushSelected;
        public SolidColorBrush FillBrushSelected
        {
            get
            { return _FillBrushSelected; }
            private set
            {
                if (_FillBrushSelected == value)
                {
                    return;
                }
                _FillBrushSelected = value;
                RaisePropertyChanged("FillBrushSelected");
            }
        }
        #endregion 

        #region ValueProperty
        private int _Value;
        public int Value
        {
            get
            { return _Value; }
            set
            {
                if (_Value == value)
                {
                    return;
                }
                _Value = value;
                RaisePropertyChanged("Value");
            }
        }
        #endregion

        public abstract int ZIndexVal { get; set; }
        #endregion

        #region Constructor
        public PatternDesignBase(Color fillNormal, Color fillSelected, int value)
        {
            FillColNormal = fillNormal;
            FillColrSelected = fillSelected;
            Value = value;
        } 
        #endregion

        #region Methods
        public abstract void GridPosition(int row, int col);

        public abstract void MarkAsSelected();
        #endregion
    }
}
